package yz;

/**
 *  [58. 最后一个单词的长度](https://leetcode-cn.com/problems/length-of-last-word/)
 *
 * @Author yangz
 * @Date 2022/9/11 21:25
 */
public class LeetCode58_LengthOfLastWord {
    public int lengthOfLastWord(String s) {
        String trim = s.trim();
        return trim.substring(trim.lastIndexOf(" ") + 1).length();
    }
}
